function setCookie(name,value,iDay){
    var newDate = new Date();
    newDate.setDate(newDate.getDate()+iDay);
//编码  把可能为中文的编码一下
     // console.log(name)
    value = encodeURIComponent(value);
    // console.log(name)

    document.cookie=name+"="+value+";expires="+newDate+";path=/";
}



function removeCookie(cookieName) {
	setCookie(cookieName,'',-10)
}

function getCookie(cookieName) {
	//token=asdfasdf2323a; uid=123
	// console.log(document.cookie);
	var arr = document.cookie.split('; ');
	// console.log(arr);
	for(var i = 0; i < arr.length; i++) {
		var str = arr[i];
		// console.log(str);
		//token=asdfasdf2323a
		var a = str.split('=');
		if(a[0] == cookieName) {
			return decodeURIComponent(a[1]);
		}

	}
}